import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.3 * User: 花海
 * Date: 2022-07-30
 * Time: 9:33
 */
public class Main {


    public static int sum1 (int n) {
        if(n<10){
            return n;
        }else{
            return n%10+sum1(n/10);//int 类型递归往往都在return上做文章
        }


    }

    public static void main(String[] args) {
        System.out.println(sum1(123));



        }
    }

